package org.example.jdk8;

import java.util.Comparator;
import java.util.function.BinaryOperator;
import java.util.function.Supplier;

public class test4 {
    public test4() {}
    public static void main(String[] args) {
        Supplier<test4> aNew = test4::new;
        aNew.get().tt(1, 2, (x,y)-> x+y);

        check(3,5,(x,y)-> x-y);
    }
    public void tt(Integer i, Integer j, BinaryOperator<Integer> bo) {
        Integer z = bo.apply(i, j);
        System.out.println(z);
    }
    public static void check(Integer x, Integer y, Comparator<Integer> i){
        Integer z = BinaryOperator.minBy(i).apply(x,y);
        System.out.println(z);
    }
}
